package cn.javase.base.multithread._02_线程休眠与终止;

public class _02_中断线程休眠 {
    public static void main(String[] args) {
        Thread thread = new Thread(new Runnable() {
            @Override
            public void run() {
                System.out.println("自定义线程睡着了...");
                try {
                    Thread.sleep(1500000);
                } catch (InterruptedException e) {
                    System.out.println(e.getMessage());
                }
                System.out.println("自定义线程起床干活了...");
            }
        });
        thread.start();
        try {
            Thread.sleep(5000);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
        thread.interrupt();
    }
}
